
/*
1. 属性的拼接 id-{{hello}}
2. 运算
    - 三元运算
    - 逻辑判断
    - 算数运算
    - 逻辑判断
    - 字符串运算
    - 数据路径运算， .操作符，[]操作符
    - 数组的声明 <view wx:for="{{[zero, 1, 2, 3, 4]}}">{{item}}</view>
    - 对象 data="{{foo: a, bar: b}}"
    - ... 对象展开
    -
*/

const TokenType = {
    Keyword: 1,
    Identifier: 2,
    Number: 3,
    String: 4,
    Operator: 5,
    Delimiter: 6
};


class Token {

    constructor(type, text) {
        this.pos = 0;
        this.type = 0;
        this.text = null;
    }

    parse(text) {
        this.pos = 0;
        this.text = text;

        for (let i = 0; i < text.length; ++i)
        {

        }
    }
}



class Lexer {
    constructor() {

    }

    parse(text) {

        const State = {
            None: 0,

        };

        let state = State.None;
        for (let pos = 0; pos < text.length; ++pos)
        {
            let c = text[pos];

            if (state === State.None) {
                if (c.match(/[\s]/)) {
                    continue;
                }
            }
        }
    }
}


class Parser {

}


class VM {

}



